package homework;

class HourlyEmployee extends Employee {
    private double hourlySalary;
    private double totalHour;

    public HourlyEmployee(String name, int birthdayMonth, double hourlySalary, double totalHour) {
        super(name, birthdayMonth);
        this.hourlySalary = hourlySalary;
        this.totalHour = totalHour;
    }

    public double getHourlySalary() {
        return hourlySalary;
    }

    public double getTotalHour() {
        return totalHour;
    }

    public double getSalary(int month) {
        double salary = 0;
        if (totalHour <= 160) {
            salary = hourlySalary * totalHour;
        } else {
            salary = hourlySalary * 160 + hourlySalary * 1.5 * (totalHour - 160);
        }
        return salary + super.getSalary(month);
    }
}